package com.wjn.anno;

import com.wjn.validation.StateValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented//元注解

@Target({ElementType.FIELD})//元注解
@Retention(RetentionPolicy.RUNTIME)//元注解
@Constraint(
        validatedBy = {StateValidation.class}//提供校验规则的类
)
public @interface State {
    //校验失败后的提示信息
    String message() default "state参数只能是已发布或者草稿";
    //指定分组
    Class<?>[] groups() default {};
    //负载 获取state注解的附加信息
    Class<? extends Payload>[] payload() default {};

}
